/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sunsite.dao;

import org.springframework.dao.DataAccessException;
import sunsite.po.Usr;

/**
 *
 * @author Ruby
 */
public interface UsrDao {

    /**
     * 根据用户名(用户的唯一标识，非用户姓名)查找用户，userName是用户自己填写的，但需验证唯一
     * @param userName
     * @return
     * @throws org.springframework.dao.DataAccessException
     */
    Usr getUsrByUserName(String userName) throws DataAccessException;

    /**
     * 根据用户表的user_id查找用户，userId是系统自动生成的
     * @param userId
     * @return
     * @throws org.springframework.dao.DataAccessException
     */
    Usr getUsrByUserId(String userId) throws DataAccessException;

    void update(Usr user) throws DataAccessException;

    void addUser(Usr user) throws DataAccessException;

    void delete(Usr user) throws DataAccessException;

    void delete(String userName) throws DataAccessException;
}
